class AsyncPlugin {
  apply(compiler) {
    console.log(2);
    compiler.hooks.emit.tapAsync('AsyncPlugin', (compilation, cb) => {
      setTimeout(() => {
        console.log('文件发射出来 等一下');
        cb()
      }, 3000)
    })

    compiler.hooks.emit.tapPromise('AsyncPlugin', (compilation) => {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          console.log('再等三秒');
          resolve()
        }, 3000)
      })
    })
  }
}

module.exports = AsyncPlugin